package com.mobile.mapper;

import com.mobile.pojo.OrderSetting;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Date;

/**
 * @author Encounter
 * @date 2024/10/10 15:34<br/>
 */
@Mapper
public interface OrderSettingMapper
    {
        /**
         * 按订单日期查询
         *
         * @param orderDate 订购日期
         * @return {@link OrderSetting }
         */
        @Select("select * from t_ordersetting where orderDate = #{orderDate}")
        OrderSetting queryByOrderDate(Date orderDate);
        
        /**
         * 插入
         *
         * @param orderSettingUpdate 订单设置更新
         */
        @Insert("insert into t_ordersetting(orderDate, number, reservations) " +
                "values (#{orderDate} ,#{number} ,#{reservations})")
        void insert(OrderSetting orderSettingUpdate);
        
        /**
         * 更新
         *
         * @param orderSettingUpdate 订单设置更新
         * @return int 修改成功条数
         */
        int update(OrderSetting orderSettingUpdate);
    }
